<template>
  <div class="content">
    <div class="cloud-header">
      <h2>用户需求</h2>
    </div>
    <div class="cloud-body">
      <!-- <div class="cloud-subset-title">
        <div class="cloud-subset-action">
          <Button color="primary" @click="addShop">+门店管理</Button>
        </div>
        <p class="cloud-subset-tips">在开发的场景同，通常一个项目管理多个应用，如微信公众号，微信小程序，数据后台等等公用的一个数据库，此处用于区分不同应用场景<br></p>
      </div> -->
      <div class="cloud-rules-body">
        <Table :datas="datas" :loading="loading">
          <TableItem title="门店名称 " prop="name"></TableItem>
          <TableItem title="门店地址" prop="address"></TableItem>
          <TableItem title="想要产品" prop="content"></TableItem>
          <TableItem title="需求卡券" >
            <template slot-scope="{data}">
              {{ticket_need(data.ticket_need)}}
            </template>
          </TableItem>
          <div slot="empty">暂时无数据</div>
        </Table>
      </div>
    </div>
  </div>
</template>
<script type="text/javascript">
export default {
  data() {
    return {
      loading: false,
      datas: []
    };
  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {
    this.initialize();
  },
  methods: {
    ticket_need(value) {
      let str = ''
      for (var i in value) {
      	str += value[i]+' '
      }
      return str
    },
    initialize() {
      this.loading = true;
      this.$cloud.name('advice').limit(-1).select().then(res => {
        this.datas = res;
        this.loading = false;
      }).catch(error => {
        this.loading = false;
      });
    },
  }
};

</script>
<style lang="less" scoped="true">
.cloud-rules-body {
  margin: 0 15px;
}

</style>
